NEW @W-19365711@ Converted package versioning enforcement to git hooks - #339
Merged
Conversation
jfeingold35
commented
Aug 27, 2025
jfeingold35
left a comment
Contributor
Author
There was a problem hiding this comment.
I didn't need to change anything in the publishing flow, because the commit in the publishing flow is done via graphQL, which I believe should sidestep Husky entirely.
stephen-carter-at-sf
requested changes
Aug 27, 2025
stephen-carter-at-sf
approved these changes
Aug 27, 2025
stephen-carter-at-sf
requested changes
Aug 27, 2025
stephen-carter-at-sf
requested changes
Aug 27, 2025
Comment on lines
+58
to
+59
| git diff --name-only $HEAD_SHA $BASE_SHA > `pwd`/changed_files.txt | ||
| node ./.node-scripts/validate-changed-package-versions.js `pwd`/changed_files.txt |
Contributor
There was a problem hiding this comment.
In addition to the husky precommit stuff... do you want to also update these to use the .scatchfile as well?
Contributor
Author
There was a problem hiding this comment.
We could, but it doesn't matter terribly because there's no chance of the file being committed or anything like that.
| } | ||
| const releasedPackageVersion = getLatestReleasedVersion(changedPackage); | ||
| if (semver.lte(semver.parse(packageVersion.slice(0, packageVersion.length - 9)), semver.parse(releasedPackageVersion))) { | ||
| incorrectlyVersionedPackages.push(`${changedPackage} (currently versioned as ${packageVersion}) is semantically behind latest published release ${releasedPackageVersion}`); |
Contributor
There was a problem hiding this comment.
I think this should say is semantically not ahead of latest... because it could be equal.
stephen-carter-at-sf
approved these changes
Aug 27, 2025
stephen-carter-at-sf
left a comment
Contributor
There was a problem hiding this comment.
Please fix my last 2 comments. Then you are good to merge.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.